The Source Control Integration API > The source control integration API overview |
![]() ![]() ![]() |
The source control integration API overview
The source control integration API allows you to write DLLs to extend Dreamweaver's check in/check out feature using the features of other source control systems (such as Sourcesafe, CVS, or Whirlwind). These API functions can also be used to describe how the Dreamweaver user can interact with the integrated source control system.
You implement this API by writing a C-level DLL/shared code fragment that adheres to the API defined in this chapter. There is a minimum set of API functions that you must support in order for Dreamweaver to integrate with a source control system. The DLLs are placed in the Configuration/SourceControl folder.
When started, Dreamweaver loads each DLL file. Dreamweaver determines which of the APIs the DLL supports by calling GetProcAddress()
on the various APIs. If an address doesn't exist, Dreamweaver assumes the DLL does not support the API. If the address exists, Dreamweaver uses the DLL's version of the function to support the functionality. When a Dreamweaver user defines or edits a site and then chooses the Web Server SCS tab, the choices corresponding to the DLLs that were loaded from the Configuration/SourceControl folder appear (in addition to the standard items) on the tab.
To add custom items to the Site > Source Control menu, add the following code in the Site menu in the menus.xml file:
<menu name="Source Control" id="DWMenu_MainSite_Site_Source¬ Control"><menuitem dynamic name="None "file="Menus/MM/¬ File_SCSItems.htm" id="DWMenu_MainSite_Site_NewFeatures_Default" /> </menu>
When a Dreamweaver user chooses server connection, file transfer, or Design Notes features, Dreamweaver calls the DLL's version of the corresponding API function (Connect()
, Disconnect()
, Get()
, Put()
, Checkin()
, Checkout()
, Undocheckout()
, and Synchronize()
). The DLL is responsible for handling the request, including displaying dialog boxes that gather information or allow the user to interact with the DLL. The DLL is also responsible for displaying information or error messages.
The source control system can optionally support Design Notes and Check In/Check Out. The Dreamweaver user enables Design Notes in source control systems by choosing the Design Notes tab in the Define Sites dialog and checking the box to enable the feature; this is the same way that they enable Design Notes with FTP and LAN in version 3.0. If the source control system does not support Design Notes and the user wants to use this feature, Dreamweaver transports Design Note (.mno) files to maintain the Design Notes (as it does with FTP and LAN in version 3.0).
Check In/Check Out is treated differently than the Design Notes feature; if the source control system supports it, the user cannot override its use from the Design Notes dialog box. If the user tries to override the source control system, an error message appears.
Adding source control system functionality
You can add source control system functionality to Dreamweaver by writing a GetNewFeatures
handler that returns a set of menu items and corresponding C functions. For example, if you were writing a Sourcesafe DLL and wanted to allow Dreamweaver users to see the history of a file, you could write a GetNewFeatures
handler that returned the History menu item and the C function name of history
. Then, when the user right-clicks a file, the History menu item is one of the items on the menu. If a user chooses the History menu item, Dreamweaver calls the history function, passing the selected file(s) to the DLL. You would then have the DLL display the History dialog box so the user could interact with it just like they would if using Sourcesafe.
![]() ![]() ![]() |